import request from '@/utils/request'

// 登陆请求

export function login(data) {
  return request({
    url: '/frame/login',
    method: 'post',
    data
  })
}

// 获取用户资料
export const getUserpostAPI = () => {
  return request({
    method: 'POST',
    url: '/frame/profile',
  })
}
// 获取用户列表
export const getUserListApi = (params) => {
  return request({
    method: "GET",
    url: "/users",
    params,
  });
};
// 获取权限组列表
export const getPermissionsApi = (params) => {
  return request({
    method: "GET",
    url: "/permissions",
    params,
  });
};
// 添加
export const addUsersApi = (data) => {
  return request({
    method: "post",
    url: "/users",
    data,
  });
};
// 获取用户详情
export const getUsersInfoApi = (id) => {
  return request({
    method: "get",
    url: "/users/" + id
  })
}
// 修改
export const editUsersApi = (data) => {
  return request({
    method: "put",
    url: "/users/" + data.id,
    data
  })
}
// 删除
export const delUsersApi = (id) => {
  return request({
    method: "delete",
    url: "/users/" + id
  })
}
